/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin			*/
/*	Project:					*/
/*	Author:		gong_libin			*/
/*	Date:		2011_09_22			*/
/*	File:		GlbGeneral.h			*/
/********************************************************/

#ifndef	_MTGENERAL_H
#define	_MTGENERAL_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#define	UINT				unsigned int
#define	UCHAR				unsigned char
#define	ULONG				unsigned long
#define	USHORT				unsigned short
#define	ULONGLONG			unsigned long long

#define	BUFFER_SIZE			512
#define	PACKET_SIZE			1024

#define	GLB_SUCCESS			0
#define	GLB_FAILURE			-1

#define	GLB_ERROR(format, args...)	do {				\
	fprintf(stderr, "[ERROR] %s %04d: ", __FILE__, __LINE__);	\
	fprintf(stderr, format, ##args);				\
} while (0)

#define	GLB_PRINT(format, args...)	do {				\
	fprintf(stdout, format, ##args);				\
	fflush(stdout);							\
} while (0)

#define	GLB_DEBUG(format, args...)	do {				\
	fprintf(stdout, "[DEBUG] %s %04d: ", __FILE__, __LINE__);	\
	fprintf(stdout, format, ##args);				\
	fflush(stdout);							\
} while (0)

#endif /* _MTGENERAL_H */
